import React, { Component } from 'react'
import { Provider } from 'react-redux'
import store from './store'
import { BrowserRouter, Route } from 'react-router-dom'
import Header from './components/header'
import Home from './views/home'
// import Detail from './views/detail'
// 改为异步加载的形式
import Detail from './views/detail/loadable.js'
class App extends Component {
  render() {
    return (
      <Provider store={store}>
        <BrowserRouter>
          <div className="App">
            <Header age={24} />
            <div className="content">app页面</div>
            <Route path="/" exact component={Home} />
            {/* 动态参数
             url /detail/1
             path /detail/:id
             获取  this.props.match.params.id
              固定参数
             url  /detail?id=1
             path /detail
             获取 this.props.localtion.search  
            
            */}
            <Route path="/detail" exact component={Detail} />
          </div>
        </BrowserRouter>
      </Provider>
    )
  }
}

export default App
